package se.dolkow.skola.datasakerhet.server.storage;

public class Record {
	private String content;
	
	private Patient patient;
	private Doctor doctor;
	private Nurse nurse;

	private Division division;
	
	private int id;
	
	private static int id_counter = 0;
	
	Record(String content, Patient patient, Doctor doctor, Nurse nurse, Division div) {
		this.content = content;
		this.patient = patient;
		this.doctor = doctor;
		this.nurse = nurse;
		this.division = div;
		synchronized(Record.class) {
			this.id = ++id_counter;
		}
	}
	
	Record(Patient patient, Doctor doctor, Nurse nurse, Division div) {
		this("", patient, doctor, nurse, div);
	}
	
	String getContent() {
		return content;
	}
	
	void setContent(String content) {
		this.content = content;
	}
	
	public int getId() {
		return id;
	}
	
	public Patient getPatient() {
		return patient;
	}
	
	public Doctor getDoctor() {
		return doctor;
	}
	
	public Nurse getNurse() {
		return nurse;
	}
	
	public Division getDivision() {
		return division;
	}
	
	public String toString() {
		return id + ": " + patient + ", doctor " + doctor + ", nurse " + nurse + ", division: " + division.getName();
	}
}
